package rtti;

import framework.AbstractTest;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import utils.Log;

class MessageEvent {
  private String message;
  public  MessageEvent(String message){
    this.message=message;
  }

  public String getMessage() {
    return message;
  }

  public void setMessage(String message) {
    this.message = message;
  }

  @Override
  public String toString() {
    return "MessageEvent{" +
        "message='" + message + '\'' +
        '}';
  }
}

public class ClassType extends AbstractTest {

  private final Map<Class<?>, String> subscriptionsByEventType;

  public ClassType() {
    subscriptionsByEventType = new HashMap<>();
  }

  @Override
  public void test(String[] args) {
    super.test(args);

    subscriptionsByEventType.put(String.class, String.class.getCanonicalName());
    subscriptionsByEventType.put(MessageEvent.class, MessageEvent.class.getCanonicalName());

    String as = subscriptionsByEventType.get(Object.class);
    Log.vn("as:" + as);


    Log.vn("isAssignableFrom:" + String.class.isAssignableFrom(Object.class));
    Log.vn("isAssignableFrom:" + Object.class.isAssignableFrom(String.class));
  }
}
